﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter02.MainEnteyPoint
{
    public class MainEntryPoint
    {
        public static void Demo()
        {
            bool isZero = false;
            int ii = 0;

            if (ii == 0)
            {
                isZero = true;
                Console.WriteLine("i is Zero");
            }
            else
            {
                isZero = false;
                Console.WriteLine(isZero);
                Console.WriteLine("i is not Zero");

            }

            Console.WriteLine("Type is string");
            string input;
            input = Console.ReadLine();
            if (input == "")
            {
                Console.WriteLine("You typed in an empty string.");

            }
            else if (input.Length < 5)
            {
                Console.WriteLine("The string had less than 5 characther.");
            }
            else if (input.Length < 10)
            {
                Console.WriteLine("The string had at least 5 but less than 10 Characters.");
            }
            Console.WriteLine("The string was " + input);

            int integerA = 3;

            switch (integerA)
            {
                case 1:
                    Console.WriteLine("integerA =1");
                    break;

                case 2:
                    Console.WriteLine("integerA =2");
                    break;

                case 3:
                    Console.WriteLine("integerA =3");
                    break;

                case 4:
                    Console.WriteLine("integerA =4");
                    break;

                default:
                    Console.WriteLine("integerA is no 1,2, 3, or 4");
                    break;
            }

            for (int i = 0; i < 100; i += 10)
            {
                for (int j = 0; j < i + 10; j++)
                {
                    Console.Write(" " + j);
                }
                Console.WriteLine();
            }

            bool condition = false;
            while (!condition)
            {
                //TODO...
                break;
            }

            do
            {
                //TODO...
            } while (condition);


            var arrayOfInts = new List<int> { 1, 1, 2, 2, 3, 213213 };
            foreach (var item in arrayOfInts)
            {
                Console.WriteLine(item);
            }
        }
    }
}
